﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 女友管理系统2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void addbutton_Click(object sender, EventArgs e)
        {
            Form2 form2 = new Form2();
            form2.ShowDialog();
            string str = form2.add;
            listBox1.Items.Add(str);
        }

        private void changebutton_Click(object sender, EventArgs e)
        {
            string str = listBox1.SelectedItem.ToString();
            string[] strs = str.Split();
            string name = strs[0];
            string date = strs[1];
            string intere = strs[2];


            Form2 form2 = new Form2(name, date, intere);
            form2.ShowDialog();

            string str1 = form2.add;
            listBox1.Items.Add(str1);
            listBox1.Items.RemoveAt(listBox1.SelectedIndex);
        }
    }
}
